//
//  HXMaterPersonVC.m
//  ZCooking
//
//  Created by 韩旭 on 16/9/24.
//  Copyright © 2016年 HX_. All rights reserved.
//

#import "HXMaterPersonVC.h"
#import "HX_Macro.h"
#import "Masonry.h"
@interface HXMaterPersonVC ()<UITableViewDataSource, UITableViewDelegate>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) UIImageView *headerImg;
@end

@implementation HXMaterPersonVC
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];

   
}
- (UITableView *)tableView {
    if (!_tableView) {
        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, -64, 0, 0) style:0];
        _tableView.delegate = self;
        _tableView.dataSource = self;
        _tableView.tableHeaderView = self.headerImg;
        [_tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"tableView"];
    }
    return _tableView;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [self creatHeaderView];
    [self.view addSubview:self.tableView];
    [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.height.mas_equalTo(self.view);
        make.top.right.left.mas_equalTo(0);
    }];
}
- (void)creatHeaderView {
    self.headerImg = [[UIImageView alloc] init];
    self.headerImg.backgroundColor = [UIColor orangeColor];
    self.headerImg.HX_x = 0;
    self.headerImg.HX_y = 0;
    self.headerImg.HX_width = SCREEN_WIDTH;
    self.headerImg.HX_height = 200;
    [self.view addSubview:self.headerImg];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"tableView"];
    cell.backgroundColor = COLORAUTO;
    return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return SCREEN_HEIGHT;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
